# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Roel Gerrits <roel@roelgerrits.nl>
pkgname=nodm
pkgver=0.13
pkgrel=3
pkgdesc='X display manager for automatic logins'
arch=('loong64' 'x86_64')
url='https://github.com/spanezz/nodm'
license=('GPL')
depends=('pam' 'xorg-xinit')
makedepends=('help2man')
backup=('etc/nodm.conf')
source=("https://github.com/spanezz/nodm/archive/${pkgver}.tar.gz"
     	"nodm.conf"
     	"nodm.service")
sha512sums=('0ccbe529c6c94e3518f4bd904147841e9929578004a87ece85cc0f8695f6a15d36cefa1ccae13aae677c93f686116e45f1387c523709d7b7bb7d12831abd4bde'
            '3da879a9362bf514b8ae9fbeb586489f203f1aff538162074e8b8bdd148a813f2a5d9f187a4396221c5a2b6b1dd44e3d11d43911b7a8220fe0682e0dec3b248f'
            '21214122072daec9c373c99d1c9c0898f58a277f90fab085b417989c62e6cf268fb52148f76ec12b9be23137af05059f37f901e3d54f49e6024a05fa75277381')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"

    ./autogen.sh
	./configure --prefix=/usr/
	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	install -Dm755 nodm ${pkgdir}/usr/bin/nodm
	install -Dm644 ../nodm.conf ${pkgdir}/etc/nodm.conf
	install -Dm644 ../nodm.service ${pkgdir}/usr/lib/systemd/system/nodm.service
}
